package com.wentao.mall.exception;

/**
 * 自定义异常枚举
 */
public enum MallExceptionEnum {
    NEED_USERNAME(10001,"用户名不为空"),
    NEED_PASSWORD(10002,"密码不能为空"),
    ILLEGAL_PASSWORD(10003,"非法密码"),
    WRONG_USER_PWD(10004,"错误的用户名或密码"),
    NAME_ALREADY_EXISTS(10005,"名字已存在"),
    USER_INSERT_FAILED(10006,"用户插入失败"),
    NEED_USERNAME_PWD(10007,"需要用户名或密码"),
    NEED_LOGIN(10008,"请先登录"),
    UPDATE_FAINED(10009,"更新失败"),
    NEED_ADMIN(10010,"需要管理员身份"),
    PARAMETER_ERROR(10011,"参数错误"),
    DELETE_FAILED(10012,"删除失败"),
    DIR_ERROR(10013,"路径错误"),
    STOCK_SHORTAGE(10014,"库存不足"),
    PRODUCT_NOT_EXIST(10015,"商品不存在"),
    PRODUCT_NOT_SELL(10016,"商品已下架"),
    CART_IS_EMPTY(10017,"购物车为空"),
    NO_ENUM(10018,"无该订单状态"),
    ORDER_NOT_FOUND(10019,"订单未找到"),
    DELIVERED_FAILED(10020,"发货失败"),
    WRONG_ORDER_STATUS(10021,"错误的订单状态"),
    NOT_YOUR_ORDER(10022,"非本人订单"),
    SYSTEM_ERROR(20000,"系统异常"),
    METHOD_ILLEGAL(20001,"http方法错误");

    private Integer status;
    private String msg;

    MallExceptionEnum(Integer status, String msg) {
        this.status=status;
        this.msg=msg;
    }

    public Integer getStatus() {
        return status;
    }

    public String getMsg() {
        return msg;
    }
}

